{extend name="$_tpl_public_layout_ace"/}


{block name="breadcrumb"}
<ul class="breadcrumb">
	<li><i class="fa fa-home home-icon"></i><a href="{:url('manage/index/index')}">{:config('web_site_title')}</a></li>
	<li><a href="{:url('seatsel/manage/index')}">{:config('proj_name')}</a></li>
	<li><a href="{:url('seatsel_manage/hall/index')}">{$sideName}</a></li>
</ul>
{/block}


{block name="pageheader"}
<h1>
	{$sideName}
</h1>
{/block}


{block name="content"}
<link rel="stylesheet" href="/tplnew/seatsel/css/seatbook.css">

<div class="box box-warning">
	<div class="box-body">
		影厅名称:{$hallInfo['name']}
	</div>
</div>

<div class="well seat-label col-md-12">
	<ul class="list-unstyled centered">
		<li class="col-md-3">
			<span class="seatavailable">可选座位</span>
		</li>
		<li class="col-md-3">
			<span class="seatdisabled">不可选座位</span>
		</li>
		<li class="col-md-3">
			<span class="noseats">空白区域</span>
		</li>
	</ul>
</div>

<p class="text-center">
	提示：<strong>请先生成座位图，然后选择座位再设置座位的类型。<br>比如您可以把过道设为"空白区域"、可以把损坏需要维修的座位设为"不可选座位"</strong>
</p>

<form method="post" action="{:url('seatsel_manage/hall/saveSeats')}" enctype="multipart/form-data" class="bs-example form-horizontal J_ajaxForm">
	<input type="hidden" name="hid" value="{$hid}" />
	
<div>
	<div class="col-md-6" style="padding-left:0px;">
		<div class="well">
			<h3>设置影厅大小</h3>
			<p><input type="text" id="seat-rows" name="rows" value="{$hallInfo['rows']}" class="form-control disinline zz-length2" /> <b>竖列</b></p>
			<p><input type="text" id="seat-cols" name="cols" value="{$hallInfo['cols']}" class="form-control disinline zz-length2" /> <b>横排</b></p>
			<input class="btn btn-primary" type="button" onclick="generate_grid()" value="生成座位图">
		</div>
	</div>

	<div class="col-md-6" style="padding-right:0px;">
		<div class="well" style="height: 200px;">
			<h3>设置选中座位的类型</h3>
			<div class="seat-marker-div col-md-8" style="padding-left:0px;">
				<label class="radio-inline"><input type="radio" name="seat-marker" value="seat-available" />可选座位</label>
				<label class="radio-inline"><input type="radio" name="seat-marker" value="seat-disabled" />不可选座位</label>
				<label class="radio-inline"><input type="radio" name="seat-marker" value="no-seats" />空白区域(无座)</label>
			</div>
			<div style="clear:both">&nbsp;</div>
			<input class="btn btn-primary" type="button" onclick="mark_seats()" value="设置">
		</div>
	</div>
</div>

<div class="clearfix"></div>

<div>
	<div class="seat-administration">
		<div class="seat-grid text-center">
			<div class="blank-row">
				<div class="seat-all-toggle">全选</div>
				{volist name="colArr" id="vo"}
					<div act="{$i}" class="col-selector">{$vo}</div>
				{/volist}
			</div>
			{volist name="rowArr" id="vo"}
			<div id="row-{$vo}" class="seat-row">
				<div act="{$vo}" class="row-selector">{$vo}</div>
				{volist name="colArr" id="vo2"}
				<?php
					$seatInfo = $seats[$vo][$vo2];
					//print_r($seatInfo);exit;
					$seatVal = '';
					if ($seatInfo == 1) {
						$seatVal = 'seat-available';
					} else if ($seatInfo == 2) {
						$seatVal = 'seat-disabled';
					} else if ($seatInfo == 3) {
						$seatVal = 'no-seats';
					}
				?>
				<div id="{$vo}-{$vo2}" class="seat {$seatVal}">
					<input type="text" name="seat[{$vo}][{$vo2}]" id="class-{$vo}-{$vo2}" value="{$seatVal}" />
				</div>
				{/volist}
			</div>
			{/volist}
		</div>
	</div>
</div>

<div class="tac mt10">
	<button type="submit" class="btn btn-primary btn-sm J_ajaxSubmit">保存修改</button>
</div>
	
</form>
{/block}


{block name="script"}
<script type="text/javascript" src="/tplnew/seatsel/js/seatbook.js"></script>
{/block}